package com.ipc.app.sheduler.impl;

import java.util.LinkedList;
import java.util.List;

import com.ipc.app.biz.OrderBiz;
import com.ipc.app.model.Order;
import com.ipc.app.sheduler.IPCSheduler;
import com.ipc.app.sheduler.task.IPCTask;
import com.ipc.app.sheduler.task.impl.PaymentExpiredTask;

/**
 * @author 雪
 * 
 */
public class PayementExpiredSheduler extends AbstractIPCSheduler implements
		IPCSheduler {

	private OrderBiz orderBiz;

	@Override
	public List<IPCTask> getTaskList() {
		List<Order> expiredOrders = orderBiz.queryExpiredOrder();
		List<IPCTask> tasks = new LinkedList<IPCTask>();
		for (Order expiredOrder : expiredOrders) {
			PaymentExpiredTask ipcTask = new PaymentExpiredTask();
			ipcTask.setOrderId(expiredOrder.getOrderId());
			ipcTask.setOrderBiz(orderBiz);
			tasks.add(ipcTask);
		}

		return tasks;
	}

	public void setOrderBiz(OrderBiz orderBiz) {
		this.orderBiz = orderBiz;
	}

}
